home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d21
/
vfos_dv.arc
/
VIO_DRCT.INC
< prev
next >
Wrap
Text File
|
1990-08-09
|
14KB
|
513 lines
;
; VFOS_IBM VFOSSIL driver by Bob Hartman (SysOp of 1:132/101).
; Copyright 1988 by Spark Software. ALL RIGHTS RESERVED.
;
VioGetMode proc far
Enter_Vio
Check_Handle 00
les di,[bp+8] ; get pointer to buffer
mov cx,es:[di] ; get length
push cs ; set up ds
pop ds
mov si,offset mode_info ; get pointer to mode buffer
cmp cx,es:[di] ; how does it stack up
jbe f00_100 ; it looks ok
mov cx,es:[di] ; get the other value
f00_100:
cmp cx,3 ; is it less than 3
jae f00_101 ; it is still good
mov ax,382 ; bad buffer size
jmp f00_out ; get out
f00_101:
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 00,6 ; get out
VioGetMode endp
VioSetMode proc far
mov ax,355
ret 6
VioSetMode endp
VioGetConfig proc far
Enter_Vio
Check_Handle 02
les di,[bp+8] ; get pointer to buffer
mov cx,es:[di] ; get length
push cs ; set up ds
pop ds
mov si,offset mode_info ; get pointer to mode buffer
cmp cx,es:[di] ; how does it stack up
jbe f02_100 ; it looks ok
mov cx,es:[di] ; get the other value
f02_100:
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 02,6 ; get out
VioGetConfig endp
VioWrtTTY proc far
Enter_Vio
Check_Handle 03
push cs
pop ds
mov ax,ansi_state ; get current ANSI mode
mov cx,[bp+8] ; get string length
lds dx,[bp+10] ; get pointer to string
or ax,ax ; are we in ANSI mode?
jz f03_100 ; no ANSI, do it the other way
mov ah,40h ; set up for a write call
mov bx,1 ; use stdout
int 21h ; go do it
jmp f03_ok ; get out
f03_100:
mov si,dx ; get the pointer to ds:si
f03_101:
lodsb ; get a byte
mov ah,0eh ; write TTY mode
mov bh,0 ; page number
int 10h ; go do it through the BIOS
loop f03_101 ; do another one
f03_ok:
mov ax,0 ; say it was all ok
Exit_Vio 03,8 ; get out
VioWrtTTY endp
VioGetANSI proc far
Enter_Vio
Check_Handle 04
push cs
pop ds
mov ax,ansi_state ; get current ansi state
les di,[bp+8] ; get pointer for where to put it
stosw ; mov it there
mov ax,0 ; all is ok
Exit_Vio 04,6 ; get out
VioGetANSI endp
VioSetANSI proc far
Enter_Vio
Check_Handle 05
lds si,[bp+8] ; get the pointer to the state
lodsw ; get the state
push cs
pop ds
mov ansi_state,ax ; save it away
mov ax,0 ; all ok
Exit_Vio 05,6 ; get out
VioSetANSI endp
VioGetCurPos proc far
Enter_Vio
Check_Handle 06
mov ah,3 ; get cursor position BIOS call
mov bh,0
int 10h ; actually get it
les di,[bp+8] ; get the pointer to the row
mov dh,al ; save row in al
xor ah,ah ; clear out ah
stosw ; store the row
les di,[bp+12] ; get the pointer to the column
mov dl,al ; get the column to al
stosw ; store the column
mov ax,0 ; all ok
Exit_Vio 06,10 ; get out
VioGetCurPos endp
VioSetCurPos proc far
Enter_Vio
Check_Handle 07
mov ah,2 ; BIOS call to set the cursor pos
mov bh,0
mov dh,byte ptr [bp+10] ; get the row
cmp dh,0 ; check to see it is ok
jae f07_100
mov ax,358 ; no good
jmp f07_out
f07_100:
cmp dh,24 ; check it again
jbe f07_101
mov ax,358 ; no good
jmp f07_out
f07_101:
mov dl,byte ptr [bp+8] ; get the column
cmp dl,0 ; check if it is ok
jae f07_102
mov ax,359 ; no good
jmp f07_out
f07_102:
cmp dl,79 ; check it again
jbe f07_103
mov ax,359 ; no good
jmp f07_out
f07_103:
int 10h ; do the BIOS call
mov ax,0 ; all ok
Exit_Vio 07,6 ; get out
VioSetCurPos endp
VioGetCurType proc far
Enter_Vio
Check_Handle 08
les di,[bp+8] ; get pointer to buffer
push cs ; set up ds
pop ds
mov si,offset curs_info ; get pointer to cursor info
mov cx,8 ; length of cursor info
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 08,6 ; get out
VioGetCurType endp
VioSetCurType proc far
Enter_Vio
Check_Handle 09
mov ax,cs
mov es,ax
mov ds,ax
lds si,[bp+8] ; get pointer to buffer
mov ch,byte ptr ds:[si] ; get column
mov cl,byte ptr ds:[si+2] ; get row
mov ax,ds:[si+6] ; get attribute
cmp ax,-1 ; is it off?
jne f09_100 ; no, so continue
mov ch,30h ; turn off cursor
mov ch,30h ; turn off cursor
f09_100:
mov ah,1
mov bh,0
int 10h ; use BIOS to set the position
mov di,offset curs_info ; get pointer to cursor info
lds si,[bp+8] ; get pointer to buffer
mov cx,8 ; length of cursor info
cld
repnz movsb ; move the data
mov ax,0 ; set up return code
Exit_Vio 09,6 ; get out
VioSetCurType endp
VioScrollUp proc far
Enter_Vio
Check_Handle 10
; set up address of upper left corner, checking for out of range
; check bottom right corner for out of range
; determine number of words to copy per line
; determine number of rows to do
; move each line
; fill in blanked lines
mov ax,116
Exit_Vio 10,16 ; get out
VioScrollUp endp
VioScrollDn proc far
Enter_Vio
Check_Handle 11
; set up address of upper left corner, checking for out of range
; check bottom right corner for out of range
; determine number of words to copy per line
; determine number of rows to do
; move each line
; fill in blanked lines
mov ax,116
Exit_Vio 11,16 ; get out
VioScrollDn endp
VioReadCellStr proc far
Enter_Vio
Check_Handle 12
Do_Row_Col 12,10,8
mov si,di ; get the address as source index
mov ax,adapter_base ; offset for color card
mov ds,ax ; ds:si is now set up
les di,[bp+14] ; get the pointer to count
mov cx,es:[di]; ; put count in cx
les di,[bp+18] ; get the pointer in es:di
cld
repnz movsb ; move the bytes
mov ax,0 ; successful return
Exit_Vio 12,14 ; get out
VioReadCellStr endp
VioReadCharStr proc far
Enter_Vio
Check_Handle 13
Do_Row_Col 13,10,8
mov si,di ; get the address as source index
mov ax,adapter_base ; offset for color card
mov ds,ax ; ds:si is now set up
les di,[bp+14] ; get length pointer
mov cx,es:[di] ; get length
les di,[bp+18] ; get the pointer in es:di
f13_100:
movsb ; move a byte
inc di ; get past attribute
loop f13_100 ; do the next one
mov ax,0 ; successful return
Exit_Vio 13,14 ; get out
VioReadCharStr endp
VioWrtCellStr proc far
Enter_Vio
Check_Handle 14
Do_Row_Col 14,10,8
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
cld
repnz movsb ; move the bytes
mov ax,0 ; successful return
Exit_Vio 14,12 ; get out
VioWrtCellStr endp
VioWrtCharStr proc far
Enter_Vio
Check_Handle 15
Do_Row_Col 15,10,8
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
f15_100:
movsb ; move a byte
inc di ; get past attribute
loop f15_100 ; do the next one
mov ax,0 ; successful return
Exit_Vio 15,12 ; get out
VioWrtCharStr endp
VioWrtCharStrAtt proc far
Enter_Vio
Check_Handle 16
Do_Row_Col 16,14,12
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+16] ; get length
lds si,[bp+8] ; get the pointer in ds:si
lodsb ; get the attribute
mov ah,al ; save the attribute
lds si,[bp+18] ; get the pointer to chars
f16_100:
lodsb ; get the character
xchg ah,al ; put in proper order
stosw ; save the cell
xchg ah,al ; save attribute again
loop f16_100 ; loop for next one
mov ax,0 ; successful return
Exit_Vio 16,16 ; get out
VioWrtCharStrAtt endp
VioWrtNAttr proc far
Enter_Vio
Check_Handle 17
Do_Row_Col 17,10,8
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
lodsb ; get the character attribute
f17_100:
inc di ; get past character byte
stosb ; save the attribute
loop f17_100 ; loop for next one
mov ax,0 ; successful return
Exit_Vio 17,12 ; get out
VioWrtNAttr endp
VioWrtNCell proc far
Enter_Vio
Check_Handle 18
Do_Row_Col 18,10,8
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
lodsw ; get the character cell in AX
cld
repnz stosw ; save the cell
mov ax,0 ; successful return
Exit_Vio 18,12 ; get out
VioWrtNCell endp
VioWrtNChar proc far
Enter_Vio
Check_Handle 19
Do_Row_Col 19,10,8
mov ax,adapter_base ; offset for color card
mov es,ax ; es:di is now set up
mov cx,[bp+12] ; get length
lds si,[bp+14] ; get the pointer in ds:si
lodsb ; get the character
f19_100:
stosb ; save the character
inc di ; get past attribute byte
loop f19_100 ; loop for next one
mov ax,0 ; successful return
Exit_Vio 19,12 ; get out
VioWrtNChar endp